// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  // 指定应用进行兼容性相关操作或检查的参考日期
  compatibilityDate: "2024-04-03",
  // 是否启用 Vue Devtools
  devtools: { enabled: false },
  components: [
    {
      path: "~/components",
      // 仅根据组件名称而不是路径自动导入组件
      pathPrefix: false,
    },
  ],
  css: [
    // 清除浏览器默认样式(需安装unocss)
    "@unocss/reset/tailwind.css",
    "~/assets/css/global.css",
  ],
  runtimeConfig: {
    redis: {
      host: "",
      port: 0,
    },
    bcrypt: {
      // 加密强度
      saltRounds: 10,
      // 重置密码时的默认密码
      defaultPassword: "123456",
    },
    jwt: {
      secret: "",
      // 过期时间(秒)
      expiresIn: 60 * 60, // 1 小时
    },
  },
  devServer: {
    port: 3000,
  },
  pinia: {
    storesDirs: ["./stores/**"],
  },
  elementPlus: { defaultLocale: "zh-cn" },
  modules: [
    "nuxt-mongoose",
    "@element-plus/nuxt",
    "@nuxt/icon",
    "@unocss/nuxt",
    "@pinia/nuxt",
    "@vueuse/nuxt",
    "pinia-plugin-persistedstate/nuxt",
  ],
});
